package com.hz.us.mapper;

import com.hz.us.model.entity.GradeEntity;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface GradeMapper {

    @Insert("insert into grades values (null, #{grade_name}, #{grade_year})")
    public int addGrade(GradeEntity gradeEntity);

    @Delete("delete from grades where id = #{gradeId}")
    public int delGrade(@Param("id") Integer gradeId);

    @Select("select * from grades")
    public List<GradeEntity> allGrades();

    @Select("select * from grades where grade_name = #{gradeName}")
    public GradeEntity selectByGradename(@Param("gradeName") String gradeName);

    @Select("select * from grades where id = #{gradeId}")
    public GradeEntity selectById(@Param("gradeId") Integer gradeId);

}
